﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using System.BusinessObjects.Transactions;
using Blazing.BusinessObjects.Cms;
using NHibernate.Criterion;

namespace Blazing.BusinessObjects.Queries
{
    public class QrySearchUrlRedirects
    {
        public static ICriteria Query(int siteId)
        {
            ICriteria qry = UnitOfWork.CurrentSession.CreateCriteria(typeof(UrlRedirect))
                .Add(Expression.Eq("Site.ID", siteId))
                .AddOrder(Order.Asc("Order"));
            return qry;
        }

        public static ICriteria Query(int siteId, bool active)
        {
            ICriteria qry = Query(siteId)
                .Add(Expression.Eq("IsActive", active));
            return qry;
        }
    }
}
